#include <iostream>
#include <string>
using namespace std;


int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c;
		string ans="";
		cin>>a>>b>>c;
		if(a+b <= c  ||  a+c <= b  ||  b+c <= a){
			cout<<"bssjx"<<endl;
			continue;
		}
		if(a == b  &&  b == c){
			cout<<"db"<<endl;
			continue;
		}
		if(a == b  ||  b == c  ||  c == a)
			ans = "dy";
		else
			ans = "pt";
		if((a*a+b*b) == c*c  ||  (a*a+c*c) == b*b  ||  (b*b+c*c) == a*a)
			ans += "zj";
		else if((a*a+b*b) < c*c  ||  (a*a+c*c) < b*b  ||  (b*b+c*c) < a*a)
			ans += "dj";
		else
			ans += "rj";
		cout<<ans<<endl;
	}
	return 0;
}
